#!/bin/bash
#使用华为云的镜像

version="7.6.1"

mkdir -p /data/tools
cd /data/tools

package_url="https://mirrors.huaweicloud.com/filebeat/${version}/filebeat-${version}-linux-x86_64.tar.gz"

wget -c ${package_url} || exit 1

tar zxvf filebeat-${version}-linux-x86_64.tar.gz

ln -sf filebeat-${version}-linux-x86_64 filebeat
mkdir -p /data/tools/filebeat/logs
mkdir -p /data/sh
ln /data/tools/filebeat/filebeat /data/sh/filebeat

echo ""
echo ""
echo "Filebeat install success! You can custom yml config file,eg:filebeat.yml 。Then run comman:filebeat -c filebeat.yml  -e"
echo "If you wants alway running ,Then run comman: nohup /data/tools/filebeat/filebeat -c /data/config/filebeat/a_filebeat.test.yml  -e &"

